package com.supreme.omsserver;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;

import javax.annotation.PreDestroy;

@Slf4j
@EnableAsync
@SpringBootApplication
public class SupremeOmsServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(SupremeOmsServerApplication.class, args);
        System.out.println("  ___  __  __ ____    ____  _____ ______     _______ ____\n" +
                " / _ \\|  \\/  / ___|  / ___|| ____|  _ \\ \\   / / ____|  _ \\\n" +
                "| | | | |\\/| \\___ \\  \\___ \\|  _| | |_) \\ \\ / /|  _| | |_) |\n" +
                "| |_| | |  | |___) |  ___) | |___|  _ < \\ V / | |___|  _ <\n" +
                " \\___/|_|  |_|____/  |____/|_____|_| \\_\\ \\_/  |_____|_| \\_\\");
        log.debug("SupremeOmsServerApplication Start Complete");

        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            System.out.println("<<<<<<<<<<");
        }));
    }

    @PreDestroy
    private void destroyServer() {
        System.out.println(">>>>>>>>>>");
    }
}
